/*
 * @Author: your name
 * @Date: 2021-04-14 19:39:48
 * @LastEditTime: 2021-04-14 20:03:46
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /flutter_demo/lib/pages/AppBar.dart
 */
import 'package:flutter/material.dart';

class AppBarDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return DefaultTabController(
        length: 2,
        child: Scaffold(
          appBar: AppBar(
            title: Text('AppBarDemo'),
            // backgroundColor: Colors.green,
            // leading: IconButton(
            //   icon: Icon(Icons.menu),
            //   onPressed: () {
            //     print('sdasd');
            //   },
            // ),
            actions: <Widget>[
              IconButton(
                  icon: Icon(Icons.search),
                  onPressed: () {
                    print('search');
                  })
            ],
            bottom: TabBar(
              tabs: <Widget>[Tab(text: '热门'), Tab(text: '推荐')],
            ),
          ),
          body: TabBarView(children: <Widget>[
            ListView(
              children: <Widget>[
                ListTile(
                  title: Text('第一个tab'),
                ),
                ListTile(
                  title: Text('第一个tab'),
                ),
                ListTile(
                  title: Text('第一个tab'),
                )
              ],
            ),
            ListView(
              children: <Widget>[
                ListTile(
                  title: Text('第二个tab'),
                ),
                ListTile(
                  title: Text('第二个tab'),
                ),
                ListTile(
                  title: Text('第二个tab'),
                )
              ],
            )
          ]),
        ));
  }
}
